#include <iostream>
#include <memory>
#include "UdpServer.hpp"
#include "Log.hpp"

using namespace std;

// ./UdpServer IP port
void Usage(string proc)
{
    cout << "Usage:\n\t" << proc << "local_ip_port\n" <<endl;
}
int main(int argc, char* argv[])
{
    if(argc != 3)
    {
        Usage(argv[0]);
        exit(USAGE_ERROR);
    }
    EnableScreen();
    string ip = argv[1];
    uint16_t port = stoi(argv[2]);

    unique_ptr<UdpServer> usvr = make_unique<UdpServer>(ip, port);//C++14
    usvr->InitServer();
    usvr->Start();
    
    return 0;
}